/* eslint-disable no-console */
import React, { useEffect } from "react";
// import Delete from './Delete'
import { List, Card } from "antd";
// import axios from "axios";
import { FileService } from "@service";
import Upload from "./Upload";
// import axios from "axios";
// import Item from 'antd/lib/list/Item';

const data = [
  {
    filename: "hkw",
  },
];
const params = {
  current: 1,
  size: 6,
};
export default function File() {
  // const [fileData, setfileData] = useState([]);

  useEffect(() => {
    console.log("你好");
    FileService.getFile(params.current, params.size).then((response) => {
      console.log(response);
    });
  }, []);

  return (
    <>
      <List
        grid={{ gutter: 16, column: 4 }}
        dataSource={data}
        renderItem={(Item) => (
          <List.Item>
            <Card title={Item.filename}>Card content</Card>
          </List.Item>
        )}
      />
      <Upload />
    </>
  );
}

// axios.get(`http://47.106.171.221:8810/oss/pageOss/${1}/${6}`)
// .then(function(response){
//   const {data:fileData} = response.data
//   // console.log(response);
//   console.log(fileData.records);
//   const shuzu = [...fileData.records]
//   // 比较两个数组是否一样
//   if (data.toString()==shuzu.toString() ) {
//     return
//   }
//   else {
//     setData([...shuzu])
//     console.log(data);
//   }

// })

// .catch(function(error){
//   console.log(error);
// })
